addpath C:\Users\Annika\Documents\AAMH\Data2022\
addpath C:\Users\Annika\Documents\AAMH\Results2022\


%1
[num,txt,raw] = xlsread('AUS_PT_IP.xlsx');
PT_AUS = num(1:141,3);
Dates_Aus = num(:,1);

%2
[num,txt,raw] = xlsread('CAN_PT_IP.xlsx');
PT_CAN = num(1:141,3);
%3
[num,txt,raw] = xlsread('CHE_PT_IP.xlsx');
PT_CHE = num(1:141,3);
%7
[num,txt,raw] = xlsread('SWE_PT_IP.xlsx');
PT_SWE = num(1:141,3);
%8
[num,txt,raw] = xlsread('Gbr_PT_IP.xlsx');
PT_GBR = num(1:141,3);
%9
[num,txt,raw] = xlsread('JAP_PT_IP.xlsx');
PT_JAP = num(1:141,3);

%11
[num,txt,raw] = xlsread('NZL_PT_IP.xlsx');
PT_NZL = num(1:141,3);
%12
[num,txt,raw] = xlsread('USA_PT_IP.xlsx');
PT_USA = num(1:141,3);

%nu importera de andra variablerna:
% MÅSTE DIFFA IP OCH XR
%1

[num,txt,raw] = xlsread('AUS_dataIP.xlsx');
XR_AUS = num(27:167,3)-num(26:166,3);
IP_AUS = num(27:167,2)-num(26:166,2);

[num,txt,raw] = xlsread('AUS_AR_IP.xlsx');
AR_IP_AUS = num(1:141,2);

[num,txt,raw] = xlsread('AUS_AR_xr.xlsx');
AR_XR_AUS = num(1:141,2);

[num,txt,raw] = xlsread('AUS_SIGMA_IP_xr.xlsx');
Sigma_XR_AUS = num(1:141,3);
Sigma_IP_AUS = num(1:141,2);



[num,txt,raw] = xlsread('CAN_dataIP.xlsx');
XR_CAN =  num(27:167,3)-num(26:166,3);
IP_CAN = num(27:167,2)-num(26:166,2);

[num,txt,raw] = xlsread('CAN_AR_IP.xlsx');
AR_IP_CAN = num(1:141,2);

[num,txt,raw] = xlsread('CAN_AR_xr.xlsx');
AR_XR_CAN = num(1:141,2);

[num,txt,raw] = xlsread('CAN_SIGMA_IP_xr.xlsx');
Sigma_XR_CAN = num(1:141,3);
Sigma_IP_CAN = num(1:141,2);

%3
[num,txt,raw] = xlsread('CHE_dataIP.xlsx');
XR_CHE =  num(27:167,3)-num(26:166,3);
IP_CHE = num(27:167,2)-num(26:166,2);


[num,txt,raw] = xlsread('CHE_AR_IP.xlsx');
AR_IP_CHE = num(1:141,2);

[num,txt,raw] = xlsread('CHE_AR_xr.xlsx');
AR_XR_CHE = num(1:141,2);

[num,txt,raw] = xlsread('CHE_SIGMA_IP_xr.xlsx');
Sigma_XR_CHE = num(1:141,3);
Sigma_IP_CHE = num(1:141,2);



[num,txt,raw] = xlsread('GBR_dataIP.xlsx');
IP_GBR = num(27:167,2)-num(26:166,2);
XR_GBR =  num(27:167,3)-num(26:166,3);


[num,txt,raw] = xlsread('GBR_AR_IP.xlsx');
AR_IP_GBR = num(1:141,2);

[num,txt,raw] = xlsread('GBR_AR_xr.xlsx');
AR_XR_GBR = num(1:141,2);

[num,txt,raw] = xlsread('GBR_SIGMA_IP_xr.xlsx');
Sigma_XR_GBR = num(1:141,3);
Sigma_IP_GBR = num(1:141,2);

%8




%9
[num,txt,raw] = xlsread('NZL_dataIP.xlsx');
XR_NZL =  num(27:167,3)-num(26:166,3);
IP_NZL = num(27:167,2)-num(26:166,2);

[num,txt,raw] = xlsread('NZL_AR_IP.xlsx');
AR_IP_NZL = num(1:141,2);

[num,txt,raw] = xlsread('NZL_AR_xr.xlsx');
AR_XR_NZL = num(1:141,2);

[num,txt,raw] = xlsread('NZL_SIGMA_IP_xr.xlsx');
Sigma_XR_NZL = num(1:141,3);
Sigma_IP_NZL = num(1:141,2);

%10
[num,txt,raw] = xlsread('SWE_dataIP.xlsx');
XR_SWE =  num(27:167,3)-num(26:166,3);
IP_SWE = num(27:167,2)-num(26:166,2);

[num,txt,raw] = xlsread('SWE_AR_IP.xlsx');
AR_IP_SWE = num(1:141,2);

[num,txt,raw] = xlsread('SWE_AR_xr.xlsx');
AR_XR_SWE = num(1:141,2);

[num,txt,raw] = xlsread('SWE_SIGMA_IP_xr.xlsx');
Sigma_XR_SWE = num(1:141,3);
Sigma_IP_SWE = num(1:141,2);

%11

[num,txt,raw] = xlsread('USA_dataIP.xlsx');

XR_USA =  num(27:167,3)-num(26:166,3);
IP_USA = num(27:167,2)-num(26:166,2);

[num,txt,raw] = xlsread('USA_AR_IP.xlsx');
AR_IP_USA = num(1:141,2);

[num,txt,raw] = xlsread('USA_AR_xr.xlsx');
AR_XR_USA = num(1:141,2);

[num,txt,raw] = xlsread('USA_SIGMA_IP_xr.xlsx');
Sigma_XR_USA = num(1:141,3);
Sigma_IP_USA = num(1:141,2);

%12
[num,txt,raw] = xlsread('JAP_dataIP.xlsx');
XR_JAP =  num(27:167,3)-num(26:166,3);
IP_JAP = num(27:167,2)-num(26:166,2);


[num,txt,raw] = xlsread('JAP_AR_IP.xlsx');
AR_IP_JAP = num(1:141,2);

[num,txt,raw] = xlsread('JAP_AR_xr.xlsx');
AR_XR_JAP = num(1:141,2);

[num,txt,raw] = xlsread('JAP_SIGMA_IP_xr.xlsx');
Sigma_XR_JAP = num(1:141,3);
Sigma_IP_JAP = num(1:141,2);


% y is depvar Nx1
% x is indep var NxK
% g is NxM group indeces (Nx1 for one-way clustering
% so what is "model"? 'linear'
% N is 282
%M is 2


countries = 8; %INTE FRA ÄN SÅ LÄNGE
T = 141;
FE = zeros(countries*T,countries-1);
N1 = 141;
FE(1:N1,1)=1;
FE((N1+1):(N1*2),2)=1;
FE((N1*2+1):(N1*3),3)=1;
FE((N1*3+1):(N1*4),4)=1;
FE((N1*4+1):(N1*5),5)=1;
FE((N1*5+1):(N1*6),6)=1;
FE((N1*6+1):(N1*7),7)=1;
%FE((N1*7+1):(N1*8),8)=1;
%FE((N1*8+1):(N1*9),9)=1;
%FE((N1*9+1):(N1*10),10)=1;
%FE((N1*10+1):(N1*11),11)=1;



% nu BNP
% NU LAGGAT ETT ÅR; ÄNDRA 23: TILL 27: FÖR SAMTIDA
[num,txt,raw] = xlsread('y_hp_86_2_8.xlsx');
%	'AUS''CAN''CHE''GBR''JAP''NOR''NZL''SWE''USA'

hp = num(2:end,2:end);

% nu BNP
% NU LAGGAT ETT ÅR; ÄNDRA 23: TILL 27: FÖR SAMTIDA
[num,txt,raw] = xlsread('y_hp_all.xlsx');
%	'AUS''CAN''CHE''DNK''DEU''GBR''JAP''NOR''NZL''SWE''USA'
%y = [PT_AUS;PT_CAN;PT_CHE;PT_GBR;PT_JAP;PT_NOR;PT_NZL;PT_SWE;PT_USA];

koll=hp(1:141,1);
Y_HP = zeros(8*141,1);
Y_HP(1:N1,1)=hp(1:141,1);
Y_HP(N1+1:2*N1,1)= hp(1:141,2);
Y_HP(2*N1+1:3*N1,1)= hp(1:141,3);
Y_HP(3*N1+1:4*N1,1)= hp(1:141,4);
Y_HP(4*N1+1:5*N1,1)= hp(1:141,5);
Y_HP(5*N1+1:6*N1,1)= hp(1:141,6);
Y_HP(6*N1+1:7*N1,1)= hp(1:141,7);
Y_HP(7*N1+1:8*N1,1)= hp(1:141,8);
